What is Spanning Tree Protocol (STP)?

Spanning Tree Protocol (STP) is a Layer 2 protocol that decides the best path for LAN traffic when multiple options exist, preventing network loops while guaranteeing redundancy in case of link failure.

How does it do this?

STP communicates using Bridge Protocol Data Units (BPDU). STP-enabled switches send BPDUs to elect a root bridge for the network, using BPDUs. All STP decisions made for the network are from the viewpoint of the root bridge, including which ports to block and which ports to forward information to.

There are multiple versions of STP. Be sure to use the same version across all switches to avoid timing issues.

STP versions:

  • Spanning Tree Protocol (STP) — IEEE 802.1d.

  • Rapid Spanning Tree Protocol (RSTP) — IEEE 802.1w. Enhances the original protocol with faster convergence and network recovery.

  • Multiple Spanning Tree Protocol (MSTP) — IEEE 802.1s. Improves upon RTSP by allowing the creation of multiple “instances” of RTSP across multiple VLANs.